www.gusucode.com > 茶都拼客网全功能版 8 > 茶都拼客网全功能版 8.8源码程序/teasdxmccom/茶都拼客网V8.8(全功能,无限制,完全开源)/admin/cp_kind.asp

    <!--#include file="../Ku_inc/Ku_sql.asp"-->
<!--#include file="../Ku_inc/Ku_config.asp"-->
<!--#include file="Ku_conn.asp"-->
<!--#include file="../Ku_inc/Ku_md5.asp"-->
<!--#include file="../Ku_inc/inc.asp"-->
<!-- #include file="Session.asp"-->

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>产品管理</title>
<link href="include/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
input{
	height:22px;
	border:1px solid #BEBEBE;
	background-color:#FFF;
	padding-top: 2px;
	padding-right: 8px;
	padding-bottom: 0pt;
	padding-left: 3px;
}
-->
</style>
</head>

<body>

<div align="center">

<table border="0" width="95%" height="70" cellpadding="0" cellspacing="0"  >
	<tr >
		<td height="32" style="border: 1px solid #D0D4D9" bgcolor="#EEEEEE" >&nbsp;<b>当前栏目:</b>&gt; 
		产品分类</td>
	</tr>
    <tr><td height="38">
    <input class="input_back" type="button" name="Submit1" value="添加产品"onclick="location.href='cp_add.asp'"/>
	<input class="input_back" type="button" name="Submit3" value="产品列表"onclick="location.href='cp_list.asp'"/>
	<input class="input_back" type="button" name="Submit2" value="管理首页"onclick="location.href='main.asp'"/></td></tr>
</table>

</div>
<div align="center">

<table border="0" width="95%"  cellpadding="3" cellspacing="10" style="border: 1px solid #D0D4D9">
	<tr bgcolor="#ffffff">
		<td height="30" bgcolor="#EEEEEE" colspan="4"><b>分 类 列 表 |</b> 
		<a href="cp_kind.asp?action=add">添 加 分 类</a></td>
	</tr>
	<%
	set rs=server.CreateObject("adodb.recordset")
sql="select * from Shangjia_kind order by id desc"
rs.open sql,conn,1,1
if rs.eof then
%>
<tr style="border: 1px solid #D0D4D9"><td>没有连接</td></tr>
<% else 

  dim k
  k=1
%>
<tr align="center" >
<% do while not rs.eof%>
<td width="25%" style="border: 1px solid #D0D4D9"><b><%=left(rs("name"),6)%></b>   [<a href="cp_kind.asp?action=edit&id=<%=rs("id")%>">修改</a>] [<a href="cp_kind.asp?action=del&id=<%=rs("id")%>">删除]</a> 
</td>
<% if k mod 4 =0 then%> 
</tr><tr align="center" bgcolor="#ffffff">
<% end if%><% k=k+1
   rs.movenext
   loop
end if
rs.close
set rs=nothing
%>
<td height="30" style="border: 1px solid #D0D4D9" ></td>
	</tr>
</table>

</div>
<%
if request("action")="del" then
id=Request.QueryString("id")

	set rs=server.createobject("adodb.recordset")
	sql="select * from Gu_pro where class="&id&" "
	rs.open sql,conn,1,1	
	if (rs.eof and rs.bof) then
	
    delsql="delete from Shangjia_kind where id="&id
    conn.execute(delsql)

    conn.close
    response.redirect"cp_kind.asp"
    else
           Response.Write "<script>alert(""此类下有产品,不能直接删除。请先删除此类下的所有产品!"");location.href=""javascript:history.back()"";</script>"
    end if
end if
%>
<!---添加分类--->
<% if request("action")="add" then%>
<div align="center">

<table border="0" width="96%" height="146" cellpadding="0" cellspacing="5"  >
     <tr><td height="30">
    
    </td></tr>
	<tr >
		<td height="30"  bgcolor="#EEEEEE" style="border: 1px solid #D0D4D9">&nbsp;<b>当前操作:</b>&gt; 
		添加分类</td>
	</tr>
    <tr><td height="66" style="border: 1px solid #D0D4D9">
    		<form method="POST" action="deal_cp.asp?action=add">

			<p> </p>
			<p align="center"><b>填写分类名称</b>:<input type="text" name="name" size="20">

			<input type="submit" value="添 加" name="B1"> <input type="reset" value="重 置" name="B2"></p>
		</form>
    	</td></tr>
</table>

</div>
<%
end if
if request("action")="edit" then
id=request("id")
set rs=server.createobject("adodb.recordset")
    sql="select * from Shangjia_kind where id="&id
    rs.open sql,conn,1,3

%>
<!--->
<!---修改分类-->
<div align="center">

<table border="0" width="96%" height="146" cellpadding="0" cellspacing="5"  >
     <tr><td height="30">
    
    </td></tr>
	<tr >
		<td height="30"  bgcolor="#EEEEEE" style="border: 1px solid #D0D4D9">&nbsp;<b>当前操作:</b>&gt; 
		修改分类</td>
	</tr>
    <tr><td height="66" style="border: 1px solid #D0D4D9">
    		<form method="POST" action="deal_cp.asp?action=edit&id=<%=rs("id")%>">

			<p> </p>
			<p align="center"><b>修改分类名称</b>:<input type="text" name="name" size="20" value="<%=rs("name")%>">
			<input type="submit" value="修 改" name="B1"> <input type="reset" value="重 置" name="B2">
</p>
		</form>
    	</td></tr>
</table>

</div>
<% end if %>
<!--->
<p align="center"><!-- #include file="Ku_bottom.asp"--></p>
</body>

</html>